from base import Base
from selenium.webdriver.common.by import By
from time import sleep

class SouSuoPage(Base):
    sousuokuang=(By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/androidx.drawerlayout.widget.DrawerLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.RelativeLayout/android.widget.RelativeLayout[2]/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.TextSwitcher/android.widget.TextView')
    sousuoanniu=(By.XPATH,'//android.widget.TextView[@text="搜索"]')

    dy=(By.ID,'com.xiachufang:id/search_suggest_right_text_view')

    def sousuoyewu(self):
        self.find_ele(self.sousuokuang).click()
        sleep(3)
        self.find_ele(self.sousuoanniu).click()
        sleep(3)

    shurukuang=(By.XPATH,'//android.widget.EditText[@resource-id="com.xiachufang:id/search_edit_text"]')

    dy2='new UiSelector().resourceId("com.xiachufang:id/tv_content")'
    dy3='new UiSelector().text("综合")'

    def sousuoddtyewu(self,neirong):
        self.find_ele(self.sousuokuang).click()
        sleep(3)
        self.find_ele(self.shurukuang).send_keys(neirong)
        sleep(3)
        self.find_ele(self.sousuoanniu).click()
        sleep(3)
